{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Jupyter基本使用"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 目录页"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "打开jupyter根目录<br>\n",
    "<img src=\"images/25.png\"/>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "点击左上角的jupyter图标可以回到根目录。<br>点击右上角的logout可以登出当前用户。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 区域1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* Files 是当前文件夹<br>\n",
    "* Running 是正在运行的kernel，一个.ipynb文件对应一个kernel<br>\n",
    "* Clusters 和大数据并行运算有关，我对此并不熟悉，使用过这个功能的同学可以给以补充\n",
    "* Nbextensions 插件"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Upload上传文件"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "更简单的上传方法是用鼠标拖动你想上传的文件到图中区域4，即可完成上传。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### New新建"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "点击New按钮<br>\n",
    "<img src=\"images/26.png\"/>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notebook下是你要新建的notebook文件的kernel类型。<br>\n",
    "kernel是jupyter的重要概念，可以理解为后台。<br>\n",
    "因为在当前环境下只安装了Python2和Python3的kernel，所以只显示了这两个。如果你下载有Julia、R、MATLAB等的kernel，这里也会显示的。<br>\n",
    "点击查看目前jupyter支持的语言及对应的kernel https://github.com/jupyter/jupyter/wiki/Jupyter-kernels"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Other下\n",
    "* Text File 是新建文本(代码)文件，可以支持绝大多数编程语言。\n",
    "* Folder 是新建文件夹。\n",
    "* Terminal 是和你的服务器新建终端连接。有了这个，你完全可以放心大胆地卸载你的Xshell。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 区域4"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "文件夹目录,和在terminal中ls命令显示的内容一致。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  .ipynb文件"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "在New里点击Python3，新建一个demo.ipynb文件"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    ".ipynb文件的视图应类似如下图<br>\n",
    "<img src='images/27.png'>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1. 点击左上角jupyter图标，回到jupyter的根目录\n",
    "2. 点击demo(初始应为Untitled)，即可重命名\n",
    "3. 菜单栏有很多功能值得探索，比如file->download as可以把文件下载到本地；View->cell toolbar Slideshow可以将该文件转为PPT，具体请自行探索\n",
    "4. Toolbar 关于编辑Cell和kernel等的功能\n",
    "5. 状态栏，这里的铅笔标志代表处于编辑状态\n",
    "6. kernel 状态栏，圆圈中心为白色时表示kernel处于正常(空闲)状态，黑色代表kernel处于繁忙或dead状态\n",
    "7. 编辑区"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "编辑区的cell有Command Mode和Edit Mode两种状态，类似Vim"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "蓝色框代表该cell处于Command Mode，此时可进行cell层面的操作，比如复制、粘贴cell，以及大多数基于系统的快捷键<br>\n",
    "绿色框代表该cell处于Edit Mode，此时可进行文本操作，比如书写代码、复制粘贴代码"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "两种状态下的快捷键可在Command Mode下，按h键查看<br>\n",
    "<img src='images/28.png'>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "当输出较长时，你可以单击或双击cell输出的左侧部分，或在command模式下使用O键将输出半折叠或完全折叠"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "在Command Mode下,<br>\n",
    "Y键将cell转换为code模式<br>\n",
    "M键将cell转换为Markdown模式<br>\n",
    "R键将cell转换为raw模式"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "使用Ctrl-Enter可执行当前cell<br>\n",
    "使用Shift-Enter可执行当前cell，并将光标移至下方cell"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "当你运行一段程序，却迟迟看不到输出时<br>\n",
    "Don't Panic,查看当前cell的前方是否为In[ * ]，且右上角kernel状态是否为黑色圆圈，这代表程序已经开始运行，您只需等待<br>"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.12"
  },
  "nbTranslate": {
   "displayLangs": [
    "*"
   ],
   "hotkey": "alt-t",
   "langInMainMenu": true,
   "sourceLang": "en",
   "targetLang": "fr",
   "useGoogleTranslate": true
  },
  "toc": {
   "nav_menu": {},
   "number_sections": false,
   "sideBar": true,
   "skip_h1_title": true,
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": "block",
   "toc_window_display": true
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
